#ifndef GX_FR_EDITOR_ENTITY_PROPERTY_H
#define GX_FR_EDITOR_ENTITY_PROPERTY_H

#include "Basic/GxLibBasic.h"
#include "Scene.h"
#include "Entity.h"

namespace FinalRendering
{
	namespace Editor
	{
		using namespace GxLibBasic;
		using namespace FinalRendering::Engine;
		class Entity;

		typedef wchar_t PropertyTypeName[256];

		class EntityProperty : public Object
		{
		protected:
			Entity * entity;
		public:
			Event<String> PickValueResult;
			static PropertyTypeName TypeName;
			String Name;
			bool ReadOnly;
			bool Pickable;
			EntityProperty(Entity * ent);
			virtual void PickValue();
			virtual String GetValue() = 0;
			virtual bool SetValue(const String & newVal) = 0;
		};

		class IntEntityProperty : public EntityProperty
		{
		protected:
			int * val;
		public:
			IntEntityProperty(Entity * ent, int * _val);
			virtual String GetValue();
			virtual bool SetValue(const String & newVal);
		};

		class FloatEntityProperty : public EntityProperty
		{
		protected:
			float * val;
		public:
			FloatEntityProperty(Entity * ent, float * _val);
			virtual String GetValue();
			virtual bool SetValue(const String & newVal);
		};

		class StringEntityProperty : public EntityProperty
		{
		protected:
			IString * val;
		public:
			StringEntityProperty(Entity * ent, IString * _val);
			virtual String GetValue();
			virtual bool SetValue(const String & newVal);
		};

		class Vec3EntityProperty : public EntityProperty
		{
		protected:
			vec3 * val;
		public:
			Vec3EntityProperty(Entity * ent, vec3 * _val);
			virtual String GetValue();
			virtual bool SetValue(const String & newVal);
		};

		class ColorEntityProperty : public Vec3EntityProperty
		{
		protected:
			vec3 * val;
		public:
			ColorEntityProperty(Entity * ent, vec3 * _val);
			virtual void PickValue();
		};

		class EntityArrayProperty : public EntityProperty
		{
		protected:
			IIntArray *entArray;
		public:
			EntityArrayProperty(Entity * ent, IIntArray * _entArray);
			virtual String GetValue();
			virtual bool SetValue(const String & newVal);
		};

		String Vec3ToString(const vec3 & v);

	}
}

#endif